package com.xckj.teacher.ui.activity

import android.app.AlertDialog
import android.content.DialogInterface
import android.widget.Toast
import com.blankj.utilcode.util.AppUtils
import com.xckj.teacher.R
import com.xckj.teacher.databinding.ActivityCancelExplainBinding
import com.xckj.teacher.framework.BaseActivity
import com.xckj.teacher.util.CacheUtil


/**
 * 撤销同意声明
 */
class CancelExplainActivity : BaseActivity<ActivityCancelExplainBinding>() {


    inner class ProxyClick {
        fun back() {
            finish()
        }

        fun cancel() {
            val builder = AlertDialog.Builder(this@CancelExplainActivity)
            builder
                .setTitle("尊敬的用户")
                .setMessage("您需同意《隐私保护声明》方可使用本软件中的产品和服务，如果撤销，将直接退出app.")
                .setCancelable(true)
                .setPositiveButton("撤销并退出APP") { dialog, which ->
                    CacheUtil.clearAll()
                    AppUtils.exitApp()
                }
                .setNeutralButton(
                    "不撤销"
                ) { dialog, which ->

                }.create().show()

        }


    }


    override fun loadLayout(): Int {
        return R.layout.activity_cancel_explain
    }

    override fun initData() {
        dataBinding.click = ProxyClick()
    }

    override fun setListener() {

    }
}